﻿// Decompiled with JetBrains decompiler
// Type: YJM_PTO.FormZC
// Assembly: YJM_PTO, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 17EE8669-AD07-48C9-A340-87C7401F98C3
// Assembly location: C:\Users\Administrator\Desktop\bin\YJM_PTO.exe

using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Windows.Forms;


namespace YJM_PTO
{
    public class FormZC : Form
    {
        private IContainer components = (IContainer)null;
        private Label label1;
        private TextBox txtCode;
        private CheckBox cbPL;
        private TextBox txtTime;
        private Label label2;
        private Button button1;
        private CheckBox cbDHY;
        private Label label3;

        public FormZC() => this.InitializeComponent();

        private void button1_Click(object sender, EventArgs e)
        {
            string str1 = this.txtCode.Text.Trim() + "\r\n";
            string str2 = "datetime:" + this.txtTime.Text.Trim();
            if (string.IsNullOrEmpty(this.txtCode.Text.Trim()))
            {
                int num1 = (int)MessageBox.Show("机器码不能为空！");
            }
            else if (string.IsNullOrEmpty(this.txtTime.Text.Trim()))
            {
                int num2 = (int)MessageBox.Show("注册时间不能为空！");
            }
            else
            {
                string str3 = "";
                string str31= "";
                if (this.cbPL.Checked)
                    str3 = "cbPL\r\n";
                if (this.cbDHY.Checked)
                    str31 = "cbDHY\r\n";
                string info = str1 + str3 +str31+ str2;
                string str4 = AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "ZCFile";
                string path = str4 + "\\zc.zz";
                if (!Directory.Exists(str4))
                    Directory.CreateDirectory(str4 + "\\");
                if (File.Exists(path))
                    File.Delete(path);
                string str5 = PublicZC.Encrypt(info);
                StreamWriter streamWriter = new StreamWriter((Stream)new FileStream(path, FileMode.Create, FileAccess.ReadWrite));
                streamWriter.WriteLine(str5);
                streamWriter.Flush();
                streamWriter.Close();
                int num3 = (int)MessageBox.Show("注册文件[zz.zc]生成成功！");
                Process.Start("explorer.exe", str4);
            }
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && this.components != null)
                this.components.Dispose();
            base.Dispose(disposing);
        }

        private void InitializeComponent()
        {
            this.label1 = new System.Windows.Forms.Label();
            this.txtCode = new System.Windows.Forms.TextBox();
            this.cbPL = new System.Windows.Forms.CheckBox();
            this.txtTime = new System.Windows.Forms.TextBox();
            this.label2 = new System.Windows.Forms.Label();
            this.button1 = new System.Windows.Forms.Button();
            this.label3 = new System.Windows.Forms.Label();
            this.cbDHY = new System.Windows.Forms.CheckBox();
            this.SuspendLayout();
            // 
            // label1
            // 
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(78, 68);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(80, 18);
            this.label1.TabIndex = 0;
            this.label1.Text = "机器码：";
            // 
            // txtCode
            // 
            this.txtCode.Location = new System.Drawing.Point(146, 65);
            this.txtCode.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
            this.txtCode.Name = "txtCode";
            this.txtCode.Size = new System.Drawing.Size(334, 28);
            this.txtCode.TabIndex = 1;
            // 
            // cbPL
            // 
            this.cbPL.AutoSize = true;
            this.cbPL.Location = new System.Drawing.Point(146, 222);
            this.cbPL.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
            this.cbPL.Name = "cbPL";
            this.cbPL.Size = new System.Drawing.Size(106, 22);
            this.cbPL.TabIndex = 3;
            this.cbPL.Text = "批量转换";
            this.cbPL.UseVisualStyleBackColor = true;
            // 
            // txtTime
            // 
            this.txtTime.Location = new System.Drawing.Point(146, 149);
            this.txtTime.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
            this.txtTime.Name = "txtTime";
            this.txtTime.Size = new System.Drawing.Size(334, 28);
            this.txtTime.TabIndex = 5;
            // 
            // label2
            // 
            this.label2.AutoSize = true;
            this.label2.Location = new System.Drawing.Point(81, 152);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(62, 18);
            this.label2.TabIndex = 4;
            this.label2.Text = "时间：";
            // 
            // button1
            // 
            this.button1.Location = new System.Drawing.Point(259, 265);
            this.button1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(84, 35);
            this.button1.TabIndex = 6;
            this.button1.Text = "注册";
            this.button1.UseVisualStyleBackColor = true;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            // 
            // label3
            // 
            this.label3.AutoSize = true;
            this.label3.ForeColor = System.Drawing.Color.Red;
            this.label3.Location = new System.Drawing.Point(143, 182);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(278, 18);
            this.label3.TabIndex = 7;
            this.label3.Text = "格式：yyyyMMdd （如 20220520）";
            // 
            // cbDHY
            // 
            this.cbDHY.AutoSize = true;
            this.cbDHY.Location = new System.Drawing.Point(356, 222);
            this.cbDHY.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
            this.cbDHY.Name = "cbDHY";
            this.cbDHY.Size = new System.Drawing.Size(124, 22);
            this.cbDHY.TabIndex = 8;
            this.cbDHY.Text = "多合一转换";
            this.cbDHY.UseVisualStyleBackColor = true;
            // 
            // FormZC
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(656, 313);
            this.Controls.Add(this.cbDHY);
            this.Controls.Add(this.label3);
            this.Controls.Add(this.button1);
            this.Controls.Add(this.txtTime);
            this.Controls.Add(this.label2);
            this.Controls.Add(this.cbPL);
            this.Controls.Add(this.txtCode);
            this.Controls.Add(this.label1);
            this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "FormZC";
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
            this.Text = "注册";
            this.ResumeLayout(false);
            this.PerformLayout();

        }
    }
}
